
const getEle0 = (selector)=>{
    return document.querySelector(selector);
}
const getEles0 = (selector)=>{
    return document.querySelectorAll(selector);
}
// getEle() 没有写return 获取不到元素
// const a = getEle(".a") //undefined
// 命名导出
export{getEle0,getEles0}

// 命名导出 (可以导出多个)
export const getEle1 = (selector)=>{
    return document.querySelector(selector);
}
export const getEles1 = (selector)=>{
    return document.querySelectorAll(selector);
}


// 默认导出(只能有一个),前面一定得有声明函数
const getEle = (selector)=>{
    return document.querySelector(selector);
}
export default getEle;
// export default getEles; 不注释会报错

// 命名导出
export const getTime = (time)=>{
    let d = new Date(time);
    const year = d.getFullYear();
    const month = d.getMonth()+1;
    const date = d.getDate();
    return `${year}-${month}-${date}`;
}